<html>
<title>Release Process</title>
<body>
<h2>Release Process</h2>

<h3>First time set up</h3>
<ul>
  <li>Make sure you have at least a Committer role</li>
  <li>Make sure you have permission to post to the <a
    href="http://google-api-java-client.blogspot.com/">Announcement Blog</a>.</li>
  <li>Download <a href="http://sourceforge.net/projects/javadiff/">JDiff</a>.</li>
  <li>Set up for pushing to central Maven repository
  <ul>
    <li>Sign up for a Sonatype JIRA account at <a
      href="https://issues.sonatype.org/">https://issues.sonatype.org</a>. Click
    <i>Sign Up</i> in the Login box, fill out the simple form, and click <i>Sign
    Up</i>.</li>
    <li>Install a GPG client from <a href="http://www.gnupg.org/">http://www.gnupg.org/</a>,
    and then create a GPG key using <a
      href="http://www.sonatype.com/people/2010/01/how-to-generate-pgp-signatures-with-maven/">these
    instructions</a>, making sure to specify a passphrase to be used every time you
    release. Make sure to run the instructions under "Distribute Your Public
    Key".</li>
    <li>Add these lines to your <code>~/.hgrc</code>: <pre><code>
[ui]
username = Your Name <i>&lt;yourname@domain.com&gt;</i>

[auth]
google-api-java-client.prefix = https://google-api-java-client.googlecode.com/hg/
google-api-java-client.username = <i>[username from <a
      href="https://code.google.com/hosting/settings">https://code.google.com/hosting/settings</a>]</i>
google-api-java-client.password = <i>[password from <a
      href="https://code.google.com/hosting/settings">https://code.google.com/hosting/settings</a>]</i>
javadoc-google-api-java-client.prefix = https://javadoc.google-api-java-client.googlecode.com/hg/
javadoc-google-api-java-client.username = <i>[username from <a
      href="https://code.google.com/hosting/settings">https://code.google.com/hosting/settings</a>]</i>
javadoc-google-api-java-client.password = <i>[password from <a
      href="https://code.google.com/hosting/settings">https://code.google.com/hosting/settings</a>]</i></code></pre></li>
    <li>Add these lines to your <code>~/.m2/settings.xml</code> (create
    this file if it does not already exist): <pre><code>&lt;settings&gt;
  &lt;servers&gt;
    &lt;server&gt;
      &lt;id&gt;google-snapshots&lt;/id&gt;
      &lt;username&gt;<i>[username for <a
      href="https://issues.sonatype.org/">https://issues.sonatype.org</a>]</i>&lt;/username&gt;
      &lt;password&gt;<i>[password for <a
      href="https://issues.sonatype.org/">https://issues.sonatype.org</a>]</i>&lt;/password&gt;
    &lt;/server&gt;
    &lt;server&gt;
      &lt;id&gt;google-releases&lt;/id&gt;
      &lt;username&gt;<i>[username for <a
      href="https://issues.sonatype.org/">https://issues.sonatype.org</a>]</i>&lt;/username&gt;
      &lt;password&gt;<i>[password for <a
      href="https://issues.sonatype.org/">https://issues.sonatype.org</a>]</i>&lt;/password&gt;
    &lt;/server&gt;
    &lt;server&gt;
      &lt;id&gt;sonatype-nexus-snapshots&lt;/id&gt;
      &lt;username&gt;<i>[username for <a
      href="https://issues.sonatype.org/">https://issues.sonatype.org</a>]</i>&lt;/username&gt;
      &lt;password&gt;<i>[password for <a
      href="https://issues.sonatype.org/">https://issues.sonatype.org</a>]</i>&lt;/password&gt;
    &lt;/server&gt;
    &lt;server&gt;
      &lt;id&gt;sonatype-nexus-staging&lt;/id&gt;
      &lt;username&gt;<i>[username for <a
      href="https://issues.sonatype.org/">https://issues.sonatype.org</a>]</i>&lt;/username&gt;
      &lt;password&gt;<i>[password for <a
      href="https://issues.sonatype.org/">https://issues.sonatype.org</a>]</i>&lt;/password&gt;
    &lt;/server&gt;
  &lt;/servers&gt;
&lt;/settings&gt;</code></pre></li>
  </ul>
  </li>
</ul>

<h3>Fork version 1.6.0-beta</h3>
This is done in preparation for release of the 1.6 branch 1-2 weeks before the
official launch. We create a named Mercurial branch for 1.6. Development in the
default Mercurial branch may then progress for the next minor version.
<ul>
  <li>Create the Mercurial named branch: <pre>
hg branch 1.6
hg commit -m "create 1.6 branch in preparation for release"
hg push
hg update default
</pre></li>
  <li>For the following files, replace <code>1.6.0-beta</code> with the
  next minor version: <pre>
pom.xml
*/pom.xml
jdiff.xml (first change "1.6" to next minor version, then change "1.5" to "1.6")
release.html (first change "1.6" to next minor version, then change "1.5" to "1.6")
</pre></li>
  <li>Commit and push: <pre>
hg commit -m "Start next minor version"
hg push
</pre></li>
</ul>

<h3>Release version 1.6.0-beta</h3>
This process is followed for the official launch. We are releasing the code from
the 1.6 Mercurial branch.
<ul>
  <li>Consider changing value of $project.http.version and
  $project.oauth.version variables in pom.xml</li>
  <li>Prepare the project
  <ul>
    <li><pre>
cd /tmp
rm -rf google-api-java-client
mkdir google-api-java-client
cd google-api-java-client
hg clone -b 1.6 https://google-api-java-client.googlecode.com/hg/ 1.6
cd 1.6
</pre></li>
  </ul>
  </li>
  <li>Push to central Maven repository (based on instructions from <a
    href="https://docs.sonatype.org/display/Repository/Sonatype+OSS+Maven+Repository+Usage+Guide">Sonatype
  OSS Maven Repository Usage Guide</a>):
  <ul>
    <li>Prepare:<pre>
mvn clean deploy
mvn release:clean
mvn release:prepare -DautoVersionSubmodules=true -Dtag=1.6.0-beta --batch-mode
mvn release:perform -Darguments=-Dgpg.passphrase=<i>[YOUR GPG PASSPHRASE]</i>
</pre></li>
    <li>Release on oss.sonatype.org
    <ul>
      <li>Log in to <a href="https://oss.sonatype.org">https://oss.sonatype.org</a></li>
      <li>Click on "Staging Repositories" and look for the "com.google"
      Repository with your username</li>
      <li>check box next to uploaded release</li>
      <li>click Close button; type <code>1.6.0-beta</code> and click Close</li>
      <li>check box next to uploaded release</li>
      <li>click Release button; type <code>1.6.0-beta</code> and click
      Release</li>
    </ul>
    </li>
    <li>Central Maven repository is synced hourly. Once uploaded onto
    repo2.maven.org, it will be found at: <a
      href="http://repo2.maven.org/maven2/com/google/api-client/google-api-client/1.6.0-beta/">repo2.maven.org</a></li>
  </ul>
  </li>
  <li>Start development of next bug fix version
  <ul>
    <li>For the following files, replace <code>1.6.0-beta</code> with the
    next bug fix version:
    <ul>
      <li><code>jdiff.xml</code></li>
      <li><code>release.html</code></li>
    </ul>
    </li>
    <li><pre>
hg commit -m "start next bug fix version"
hg push
</pre></li>
  </ul>
  </li>
  <li>Prepare the released library zip file and javadoc
  <ul>
    <li>Overview: JDiff is a tool for showing the difference between the
    JavaDoc of one version of the library vs. the JavaDoc of an old version of
    the library. Hence, we will check out the last minor version of the library
    into a temporary directory and compare against the JavaDoc of the just
    released version of the library, and then hg commit that diff into the
    javadoc Hg repository.</li>
    <li><pre>
cd /tmp/google-api-java-client
hg clone --insecure https://javadoc.google-api-java-client.googlecode.com/hg/ javadoc
hg clone -r 1.5.1-beta https://google-api-java-client.googlecode.com/hg/ 1.5.1-beta
hg clone -r 1.6.0-beta https://google-api-java-client.googlecode.com/hg/ 1.6.0-beta
cd 1.6.0-beta
mvn javadoc:jar install site
cp -R target/site/apidocs ../javadoc/1.6.0-beta
</pre></li>
    <li>change these constants from jdiff.xml for your environment:
    JDIFF_HOME, MAVEN_REPOSITORY_HOME</li>
    <li><pre>
ant -f jdiff.xml
cd ../javadoc
hg add
hg commit -m "1.6.0-beta"
hg push --insecure
</pre></li>
  </ul>
  </li>
  <li><b>WAIT!</b> Don't do the following instructions until after the
  library has been uploaded to repo2.maven.org at: <a
    href="http://repo2.maven.org/maven2/com/google/api-client/google-api-client/1.6.0-beta/">repo2.maven.org</a></li>
  <li>Update to new version on <a
    href="http://code.google.com/p/google-api-java-client">http://code.google.com/p/google-api-java-client</a>
  <ul>
    <li>Upload to <a
      href="http://code.google.com/p/google-api-java-client/downloads/entry">http://code.google.com/p/google-api-java-client/downloads/entry</a>
    <ul>
      <li>Summary: Google API Client Library for Java, version 1.6.0-beta</li>
      <li>File: <code>/tmp/google-api-java-client/1.6.0-beta/google-api-client-assembly/target/google-api-client-1.6.0-beta-java.zip</code></li>
      <li>Labels: <code>Type-Archive</code>, <code>OpSys-All</code>, and <code>Featured</code></li>
      <li>click Submit file</li>
    </ul>
    </li>
    <li>If it is a bug fix release, deprecate the library from any previous
    versions by removing any <code>Featured</code> label and adding the <code>Deprecated</code>
    label.</li>
    <li>Update the following pages changing any reference from the previous
    version to the new version <code>1.6.0-beta</code>:
    <ul>
      <li><a href="http://code.google.com/p/google-api-java-client/admin">admin</a></li>
      <li><a
        href="http://code.google.com/p/google-api-java-client/w/edit/Setup">wiki/Setup</a></li>
      <li><a
        href="http://code.google.com/p/google-api-java-client/w/edit/SampleProgram">wiki/SampleProgram</a></li>
    </ul>
    </li>
  </ul>
  </li>
  <li><a
    href="http://www.blogger.com/post-create.g?blogID=4531100327392916335">New
  Post</a> on the <a href="http://google-api-java-client.blogspot.com/">announcement
  blog</a> about the new version, including links to <a
    href="http://code.google.com/p/google-api-java-client/issues/list?can=1&q=milestone=Version1.6.0%20status=Fixed&colspec=ID%20Type%20Priority%20Summary">new
  features and bugs fixed</a>.</li>
</ul>
</body>
</html>
